Optimal. Leaf size=45 \[ -\frac{i a \cos ^2(c+d x)}{2 d}+\frac{a \sin (c+d x) \cos (c+d x)}{2 d}+\frac{a x}{2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0310949, antiderivative size = 45, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 22, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.136, Rules used = {3486, 2635, 8} \[ -\frac{i a \cos ^2(c+d x)}{2 d}+\frac{a \sin (c+d x) \cos (c+d x)}{2 d}+\frac{a x}{2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3486
Rule 2635
Rule 8
Rubi steps
\begin{align*} \int \cos ^2(c+d x) (a+i a \tan (c+d x)) \, dx &=-\frac{i a \cos ^2(c+d x)}{2 d}+a \int \cos ^2(c+d x) \, dx\\ &=-\frac{i a \cos ^2(c+d x)}{2 d}+\frac{a \cos (c+d x) \sin (c+d x)}{2 d}+\frac{1}{2} a \int 1 \, dx\\ &=\frac{a x}{2}-\frac{i a \cos ^2(c+d x)}{2 d}+\frac{a \cos (c+d x) \sin (c+d x)}{2 d}\\ \end{align*}
Mathematica [A] time = 0.0560812, size = 48, normalized size = 1.07 \[ \frac{a (c+d x)}{2 d}+\frac{a \sin (2 (c+d x))}{4 d}-\frac{i a \cos ^2(c+d x)}{2 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.044, size = 42, normalized size = 0.9 \begin{align*}{\frac{1}{d} \left ( -{\frac{i}{2}}a \left ( \cos \left ( dx+c \right ) \right ) ^{2}+a \left ({\frac{\cos \left ( dx+c \right ) \sin \left ( dx+c \right ) }{2}}+{\frac{dx}{2}}+{\frac{c}{2}} \right ) \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.66952, size = 51, normalized size = 1.13 \begin{align*} \frac{{\left (d x + c\right )} a + \frac{a \tan \left (d x + c\right ) - i \, a}{\tan \left (d x + c\right )^{2} + 1}}{2 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.10973, size = 58, normalized size = 1.29 \begin{align*} \frac{2 \, a d x - i \, a e^{\left (2 i \, d x + 2 i \, c\right )}}{4 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 0.227572, size = 41, normalized size = 0.91 \begin{align*} \frac{a x}{2} + \begin{cases} - \frac{i a e^{2 i c} e^{2 i d x}}{4 d} & \text{for}\: 4 d \neq 0 \\\frac{a x e^{2 i c}}{2} & \text{otherwise} \end{cases} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.12101, size = 31, normalized size = 0.69 \begin{align*} \frac{2 \, a d x - i \, a e^{\left (2 i \, d x + 2 i \, c\right )}}{4 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]